package net.mukia.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringFactory {
	
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static Object getBean(Class clz){
		String[] files = new String[]{"applicationContext.xml"};
		ApplicationContext context = new ClassPathXmlApplicationContext(files);
		return context.getBeansOfType(clz).values().iterator().next();
	}
	
}
